Optimal. Leaf size=132 \[ \frac{\left (-3 a^2 B+2 a A b+b^2 B\right ) (a+b \sin (c+d x))^4}{4 b^4 d}-\frac{\left (a^2-b^2\right ) (A b-a B) (a+b \sin (c+d x))^3}{3 b^4 d}-\frac{(A b-3 a B) (a+b \sin (c+d x))^5}{5 b^4 d}-\frac{B (a+b \sin (c+d x))^6}{6 b^4 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.170227, antiderivative size = 132, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 31, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.065, Rules used = {2837, 772} \[ \frac{\left (-3 a^2 B+2 a A b+b^2 B\right ) (a+b \sin (c+d x))^4}{4 b^4 d}-\frac{\left (a^2-b^2\right ) (A b-a B) (a+b \sin (c+d x))^3}{3 b^4 d}-\frac{(A b-3 a B) (a+b \sin (c+d x))^5}{5 b^4 d}-\frac{B (a+b \sin (c+d x))^6}{6 b^4 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2837
Rule 772
Rubi steps
\begin{align*} \int \cos ^3(c+d x) (a+b \sin (c+d x))^2 (A+B \sin (c+d x)) \, dx &=\frac{\operatorname{Subst}\left (\int (a+x)^2 \left (A+\frac{B x}{b}\right ) \left (b^2-x^2\right ) \, dx,x,b \sin (c+d x)\right )}{b^3 d}\\ &=\frac{\operatorname{Subst}\left (\int \left (\frac{\left (-a^2+b^2\right ) (A b-a B) (a+x)^2}{b}+\frac{\left (2 a A b-3 a^2 B+b^2 B\right ) (a+x)^3}{b}+\frac{(-A b+3 a B) (a+x)^4}{b}-\frac{B (a+x)^5}{b}\right ) \, dx,x,b \sin (c+d x)\right )}{b^3 d}\\ &=-\frac{\left (a^2-b^2\right ) (A b-a B) (a+b \sin (c+d x))^3}{3 b^4 d}+\frac{\left (2 a A b-3 a^2 B+b^2 B\right ) (a+b \sin (c+d x))^4}{4 b^4 d}-\frac{(A b-3 a B) (a+b \sin (c+d x))^5}{5 b^4 d}-\frac{B (a+b \sin (c+d x))^6}{6 b^4 d}\\ \end{align*}
Mathematica [A] time = 0.245859, size = 111, normalized size = 0.84 \[ \frac{(a+b \sin (c+d x))^3 \left (3 b \left (a^2 (-B)+2 a A b+5 b^2 B\right ) \sin (c+d x)-2 a^2 A b+a^3 B-6 b^2 (2 A b-a B) \sin ^2(c+d x)-5 a b^2 B+20 A b^3-10 b^3 B \sin ^3(c+d x)\right )}{60 b^4 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.078, size = 169, normalized size = 1.3 \begin{align*}{\frac{1}{d} \left ({\frac{{a}^{2}A \left ( 2+ \left ( \cos \left ( dx+c \right ) \right ) ^{2} \right ) \sin \left ( dx+c \right ) }{3}}-{\frac{B{a}^{2} \left ( \cos \left ( dx+c \right ) \right ) ^{4}}{4}}-{\frac{Aab \left ( \cos \left ( dx+c \right ) \right ) ^{4}}{2}}+2\,Bab \left ( -1/5\,\sin \left ( dx+c \right ) \left ( \cos \left ( dx+c \right ) \right ) ^{4}+1/15\, \left ( 2+ \left ( \cos \left ( dx+c \right ) \right ) ^{2} \right ) \sin \left ( dx+c \right ) \right ) +A{b}^{2} \left ( -{\frac{\sin \left ( dx+c \right ) \left ( \cos \left ( dx+c \right ) \right ) ^{4}}{5}}+{\frac{ \left ( 2+ \left ( \cos \left ( dx+c \right ) \right ) ^{2} \right ) \sin \left ( dx+c \right ) }{15}} \right ) +B{b}^{2} \left ( -{\frac{ \left ( \sin \left ( dx+c \right ) \right ) ^{2} \left ( \cos \left ( dx+c \right ) \right ) ^{4}}{6}}-{\frac{ \left ( \cos \left ( dx+c \right ) \right ) ^{4}}{12}} \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.992413, size = 173, normalized size = 1.31 \begin{align*} -\frac{10 \, B b^{2} \sin \left (d x + c\right )^{6} + 12 \,{\left (2 \, B a b + A b^{2}\right )} \sin \left (d x + c\right )^{5} + 15 \,{\left (B a^{2} + 2 \, A a b - B b^{2}\right )} \sin \left (d x + c\right )^{4} - 60 \, A a^{2} \sin \left (d x + c\right ) + 20 \,{\left (A a^{2} - 2 \, B a b - A b^{2}\right )} \sin \left (d x + c\right )^{3} - 30 \,{\left (B a^{2} + 2 \, A a b\right )} \sin \left (d x + c\right )^{2}}{60 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.47332, size = 284, normalized size = 2.15 \begin{align*} \frac{10 \, B b^{2} \cos \left (d x + c\right )^{6} - 15 \,{\left (B a^{2} + 2 \, A a b + B b^{2}\right )} \cos \left (d x + c\right )^{4} - 4 \,{\left (3 \,{\left (2 \, B a b + A b^{2}\right )} \cos \left (d x + c\right )^{4} - 10 \, A a^{2} - 4 \, B a b - 2 \, A b^{2} -{\left (5 \, A a^{2} + 2 \, B a b + A b^{2}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{60 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 4.73452, size = 228, normalized size = 1.73 \begin{align*} \begin{cases} \frac{2 A a^{2} \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac{A a^{2} \sin{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} - \frac{A a b \cos ^{4}{\left (c + d x \right )}}{2 d} + \frac{2 A b^{2} \sin ^{5}{\left (c + d x \right )}}{15 d} + \frac{A b^{2} \sin ^{3}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{3 d} - \frac{B a^{2} \cos ^{4}{\left (c + d x \right )}}{4 d} + \frac{4 B a b \sin ^{5}{\left (c + d x \right )}}{15 d} + \frac{2 B a b \sin ^{3}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{3 d} + \frac{B b^{2} \sin ^{6}{\left (c + d x \right )}}{12 d} + \frac{B b^{2} \sin ^{4}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4 d} & \text{for}\: d \neq 0 \\x \left (A + B \sin{\left (c \right )}\right ) \left (a + b \sin{\left (c \right )}\right )^{2} \cos ^{3}{\left (c \right )} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.28835, size = 227, normalized size = 1.72 \begin{align*} -\frac{10 \, B b^{2} \sin \left (d x + c\right )^{6} + 24 \, B a b \sin \left (d x + c\right )^{5} + 12 \, A b^{2} \sin \left (d x + c\right )^{5} + 15 \, B a^{2} \sin \left (d x + c\right )^{4} + 30 \, A a b \sin \left (d x + c\right )^{4} - 15 \, B b^{2} \sin \left (d x + c\right )^{4} + 20 \, A a^{2} \sin \left (d x + c\right )^{3} - 40 \, B a b \sin \left (d x + c\right )^{3} - 20 \, A b^{2} \sin \left (d x + c\right )^{3} - 30 \, B a^{2} \sin \left (d x + c\right )^{2} - 60 \, A a b \sin \left (d x + c\right )^{2} - 60 \, A a^{2} \sin \left (d x + c\right )}{60 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]